package com.xiaoyg.consumer;

import com.xiaoyg.config.AnnotationConfiguration;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author xiaoyg
 * @Title: Consumer
 * @ProjectName spring-rabbitmq-zhu
 * @Description: 消费者
 * @date 2018/12/711:15
 */
public class Consumer {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AnnotationConfiguration.class);

        AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);

        System.out.println("Receive: "+amqpTemplate.receiveAndConvert());

    }

}
